
/**
 * AppleIIGo
 * Internal Aux Memory class
 * (C) 2007-2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */

#include "InternalAuxMemory.h"

InternalAuxMemory::InternalAuxMemory(Motherboard * motherboard) :
AuxSlotDevice(motherboard) {
}

void InternalAuxMemory::onMemoryRequested() {
	memoryOffset = motherboard->getMemory()->requestMemory(BANK_BYTENUM);
	motherboard->getMmu()->setAuxMemory(memoryOffset, true);
}

void InternalAuxMemory::onResetAsserted(bool isRestart) {
	if (!isRestart)
		return;
	
	UINT8 * memory = motherboard->getMemory()->getMemory(memoryOffset);
	for (UINT32 index = 0; index < BANK_BYTENUM; index++)
		memory[index] = 0;
}
